<?php

/**
 * Created by PhpStorm.
 * User: yangwenqu
 * Date: 2018/4/20
 * Time: 16:01
 */
class Account
{
    public $name = "zing";
    public $password;

    public function __construct($name = null, $password = null)
    {
        $this->password = $password;
    }

    public function p()
    {
        echo $this->name . PHP_EOL;
    }

    public function __toString()
    {
        return json_encode($this);
    }
}

echo (new Account(null, "1234"));